﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="type_edit.aspx.cs" Inherits="AnyOffice.general.system.workflow.flow_type.type_edit" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
	<HEAD>
		<title>编辑流程基本属性</title>		
		<script language="javascript" src="/aspnet_client/core/function.js"></script>
		<SCRIPT language="javascript">
function check_form()
{
  if(document.Form1.txtFlowNo.value == "")
  {
     alert("流程排序号不能为空！");
     document.Form1.txtFlowNo.focus();
     return false;
  } 
  
  if(!checkIsInteger(document.Form1.txtFlowNo.value))  
  {
	alert("流程排序号必须为整数！");
	document.Form1.txtFlowNo.focus();
    return false;
  }
  
  if(document.Form1.txtFlowName.value == "")
  {
     alert("流程名称不能为空！");
     document.Form1.txtFlowName.focus();
     return false;
  }
  
  if(!checkIsInteger(document.Form1.txtAutoNum.value))
  {
	alert("自动编号计数器必须为整数！");
	document.Form1.txtAutoNum.focus();
    return false;
  }
  
  if(!checkIsInteger(document.Form1.txtAutoLen.value))
  {
	alert("自动编号显示长度必须为整数！");
	document.Form1.txtAutoLen.focus();
    return false;
  }
  return true;
}

function delete_form(flow_id)
{
 msg='确认要删除该流程么？\n这将删除以下数据：\n\n1、流程描述与步骤设置\n2、依托于该流程的所有工作';
 if(window.confirm(msg))
 {
  URL="type_delete.aspx?flow_id="+flow_id+"&sort_id=<%=ViewState["SortId"]%>";
  window.location=URL;
 }
}

function empty_form(flow_id)
{
 msg='确认要清空依托于该流程的所有工作数据么？';
 if(window.confirm(msg))
 {
  URL="type_empty.aspx?flow_id="+flow_id+"&sort_id=<%=ViewState["SortId"]%>";
  window.location=URL;
 }
}

function flow_design(flow_id)
{
   window.open("type_design.aspx?flow_id="+flow_id,"flow_design","height=600,width=800,status=1,toolbar=no,menubar=no,location=no,scrollbars=yes,top=10,left=10,resizable=yes");
}

function my_tip()
{
   if(document.getElementById("tip").style.display=="none")
      document.getElementById("tip").style.display="";
   else
   	  document.getElementById("tip").style.display="none";
}
		</script>
	</HEAD>
	<body class="bodycolor" topMargin="5">
		<form id="Form1" method="post" runat="server">
			<table class="small" cellSpacing="0" cellPadding="3" width="100%" border="0">
				<tr>
					<td class="Big"><IMG height="20" src="/images/edit.gif" align="absMiddle"><span class="big3">
							编辑流程基本属性</span><br>
					</td>
				</tr>
			</table>			
			<table class="small" cellSpacing="1" cellPadding="2" width="90%" align="center" bgColor="#000000"
				border="0">
				<tr>
					<td colspan="2" class="TableHeader"><img src="/images/green_arrow.gif" align="absMiddle">
						流程基本属性</td>
				</tr>
				<tr>
					<td class="TableData" noWrap>流程分类：</td>
					<td class="TableData"><asp:dropdownlist id="ddlSortId" runat="server" CssClass="BigSelect"></asp:dropdownlist></td>
				</tr>
				<tr>
					<td class="TableData" noWrap>流程排序号：</td>
					<td class="TableData"><asp:textbox id="txtFlowNo" runat="server" CssClass="BigInput" Columns="4" MaxLength="4"></asp:textbox>
					控制同一分类下流程的排序
					</td>
				</tr>
				<tr>
					<td class="TableData" noWrap>流程名称：</td>
					<td class="TableData"><asp:textbox id="txtFlowName" runat="server" CssClass="BigInput" Columns="30"></asp:textbox></td>
				</tr>
				<tr>
					<td class="TableData" noWrap>流程类型：</td>
					<td class="TableData">
					<asp:dropdownlist id="ddlFlowType" runat="server">							
						</asp:dropdownlist></td>
				</tr>
				<tr>
					<td class="TableData" noWrap>表单：</td>
					<td class="TableData"><asp:dropdownlist id="ddlFormId" runat="server"></asp:dropdownlist></td>
				</tr>
				<tr>
					<td class="TableData" noWrap>允许附件：</td>
					<td class="TableData"><asp:dropdownlist id="ddlFlowDoc" runat="server" CssClass="BigSelect">
							<asp:ListItem Value="True">是</asp:ListItem>
							<asp:ListItem Value="False">否</asp:ListItem>
						</asp:dropdownlist></td>
				</tr>
				<tr>
					<td class="TableData" noWrap>流程说明：</td>
					<td class="TableData">
					<asp:textbox id="txtFlowDesc" runat="server" CssClass="BigInput" Rows="2" Columns="40" TextMode=MultiLine></asp:textbox>
					</td>
				</tr>
				<tr>
					<td colspan="2" class="TableHeader"><img src="/images/green_arrow.gif" align="absMiddle">
						工作名称/文号的设定</td>
				</tr>
				<tr>
					<td nowrap class="TableData">自动文号表达式：</td>
					<td class="TableData">
						<asp:TextBox id="txtAutoName" runat="server" CssClass="BigInput" Columns="30"></asp:TextBox>
						&nbsp;&nbsp;<a href="javascript:my_tip()">查看说明</a>
					</td>
				</tr>
				<tr>
					<td nowrap class="TableData">自动编号计数器：</td>
					<td class="TableData">
						<asp:TextBox id="txtAutoNum" runat="server" CssClass="BigInput" MaxLength="8" Columns="11">0</asp:TextBox>
						用于表达式编号标记
					</td>
				</tr>
				<tr>
					<td nowrap class="TableData">自动编号显示长度：</td>
					<td class="TableData">
						<asp:TextBox id="txtAutoLen" runat="server" CssClass="BigInput" MaxLength="2" Columns="4">0</asp:TextBox>
						为0表示按实际编号位数显示
					</td>
				</tr>
				<tr id="tip" style="DISPLAY:none">
					<td nowrap class="TableData">说明：</td>
					<td class="TableData">
						表达式中可以使用以下特殊标记：<br>
						{Y}：表示年<br>
						{M}：表示月<br>
						{D}：表示日<br>
						{H}：表示时<br>
						{I}：表示分<br>
						{S}：表示秒<br>
						{F}：表示流程名<br>
						{U}：表示用户姓名<br>
						{SD}：表示短部门<br>
        				{LD}：表示长部门<br>						
						{R}：表示角色<br>
						{N}：表示编号，通过 <u>编号计数器</u> 取值并自动增加计数值<br>
						<br>
						例如，表达式为：成建委发[{Y}]{N}号，编号位数为4<br>
						自动生成文号如：成建委发[2006]0001号<br>
						<br>
						例如，表达式为：BH{N}，编号位数为3<br>
						自动生成文号如：BH001<br>
						<br>
						例如，表达式为：{F}流程（{Y}年{M}月{D}日{H}:{I}）{U}<br>
						自动生成文号如：请假流程（2006年01月01日10:30）张三<br>
						<br>
						可以不填写自动文号表达式，则系统默认按以下格式，如：<br>
						请假流程(2006-01-01 10:30:30)
					</td>
				</tr>
				<tr>
					<td nowrap class="TableData">允许手工输入文号：</td>
					<td class="TableData">
						<asp:DropDownList id="ddlAutoEdit" runat="server" CssClass="BigSelect">
							<asp:ListItem Value="1">允许手工修改文号</asp:ListItem>
							<asp:ListItem Value="0">不允许手工修改文号</asp:ListItem>
							<asp:ListItem Value="2">允许在自动文号前输入前缀</asp:ListItem>
							<asp:ListItem Value="3">允许在自动文号后输入后缀</asp:ListItem>
							<asp:ListItem Value="4">允许在自动文号前后输入前缀和后缀</asp:ListItem>
						</asp:DropDownList>
					</td>
				</tr>
				<tr class="TableControl" align="center">
					<td noWrap colSpan="2">&nbsp; <input class="BigButton" onclick="return check_form();" type="submit" value="保存" name="submit">&nbsp;&nbsp;
						<input class="BigButton" onclick="history.back();" type="button" value="返回" name="back">
					</td>
				</tr>
			</table>
			<br>
			<table class="small" cellSpacing="1" cellPadding="3" width="90%" align="center" bgColor="#000000"
				border="0">
				<tr>
      <td class="TableHeader" nowrap colspan=2>
      	<img src="/images/green_arrow.gif" align="absmiddle"> <b>相关操作</b></td>
   </tr>
				<tr>
					<td class="TableData" noWrap>
					<% =ViewState["FlowType"].ToString() == "1"?"<a href='javascript:flow_design(" + ViewState["FlowId"].ToString() + ");'><img border='0' src='/images/arrow_down.gif' width='11' height='13' align='absMiddle'>流程设计器&nbsp;&nbsp; </a>":""%>
					<A href="type_setmanage.aspx?flow_id=<%=ViewState["FlowId"]%>"><IMG src="/images/node_user.gif" align="absMiddle" border="0">监控人员</A>&nbsp;&nbsp;
					<A href="type_setquery.aspx?flow_id=<%=ViewState["FlowId"]%>"><IMG src="/images/node_user.gif" align="absMiddle" border="0">查询人员</A>&nbsp;&nbsp;
					<A href="type_set_queryitem.aspx?flow_id=<%=ViewState["FlowId"]%>"><IMG src="/images/query.gif" align="absMiddle" border="0">高级查询字段</A>
					</td>
					<td class="TableData" noWrap align="center">
					    <a href="type_data.aspx?flow_id=<%=ViewState["FlowId"]%>">数据</a>
					    <a href="type_clone.aspx?flow_id=<%=ViewState["FlowId"]%>">克隆</a>
						<a href="javascript:empty_form(<%=ViewState["FlowId"]%>);">清空</a> 
						<a href="javascript:delete_form(<%=ViewState["FlowId"]%>);">删除</a>
					</td>
				</tr>
			</table>
			<br>
			<div class="small1" align=center>
			不明白如何设计表单和设计流程？请参考官方网站下载中心的《工作流使用详解》。
			</div>
			<br>
		</form>
	</body>
</HTML>
